<%@ page language="java" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>编辑-导航</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="icon" href="images/favicon.ico"
			type="image/vnd.microsoft.icon">

		<link href="<%=basePath%>css/dialog/dialog.css" rel="stylesheet">
		<link href="<%=basePath%>css/smoothness/jquery-ui.css" rel="stylesheet">
		<style type="text/css">
			body {
				font: 62.5% "Trebuchet MS", sans-serif;
				margin: 50px;
			}
			
			.demoHeaders {
				margin-top: 2em;
			}
			
			#dialog-link {
				padding: .4em 1em .4em 20px;
				text-decoration: none;
				position: relative;
			}
			
			#dialog-link span.ui-icon {
				margin: 0 5px 0 0;
				position: absolute;
				left: .2em;
				top: 50%;
				margin-top: -8px;
			}
			
			#icons {
				margin: 0;
				padding: 0;
			}
			
			#icons li {
				margin: 2px;
				position: relative;
				padding: 4px 0;
				cursor: pointer;
				float: left;
				list-style: none;
			}
			
			#icons span.ui-icon {
				float: left;
				margin: 0 4px;
			}
		</style>

		<script src="<%=basePath%>js/jquery-1.8.3.js" type="text/javascript"></script>
		<script src="<%=basePath%>js/dialog.js" type="text/javascript"></script>
		<script src="<%=basePath%>js/jquery.optionTree.js" type="text/javascript"></script>
		<script src="<%=basePath%>js/jquery-ui.min.js" type="text/javascript"></script>
		<script type="text/javascript">
    	$(function(){
    		$("#tabs").tabs({
    			selected:${tabIndex}
    		});
    		
    		var option_tree = ${optionData};
    		var options = {empty_value: -1, choose: "请选择..."};;
            $("#form21").optionTree(option_tree,options);
            $("#buttons").buttonset();
    	});
    	var MsgBox = function(text){
    		new Dialog(text,
    		{
	    		title:"消息提示"
	    	}).show();
    	}
    	function skipTo(name){
  			location.href='home/' + name + '.wkm';
  		}
    </script>

	</head>

	<body>
		<div id="tabs">
			<ul>
				<li>
					<a href="#tabs-1">编辑根节点</a>
				</li>
				<li>
					<a href="#tabs-2">编辑子节点</a>
				</li>
				<li>
					<a href="#tabs-3">编辑地址</a>
				</li>
				<li>
					<a href="#tabs-4">编辑首页</a>
				</li>
			</ul>
			<div id="tabs-1">
				<form action="home/addroot.wkm" method="post" id="form0">
					<div>
						<table border="0" style="font-size: 12">
							<tr>
								<td colspan="2">
									<input id="form01" name="itemParent" type="hidden" value="0" />
								</td>
							</tr>
							<tr>
								<td>
									名称:
								</td>
								<td>
									<input id="form02" name="itemName" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<input id="form03" name="itemType" type="hidden" value="0" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<input id="form04" name="itemSeq" type="hidden" value="0" />
								</td>
							</tr>
							<tr>
								<td>
									备注:
								</td>
								<td>
									<textarea id="form05" name="itemDesc" rows="10" cols="30"></textarea>
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<input id="form06" name="itemId" type="hidden" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<input name="sure" type="submit" value="提交" />
									<input name="cancel" type="reset" value="取消" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<c:out value="${messageForm0}"></c:out>
									<input id="form07" name="tabIndex" value="0" type="hidden" />
								</td>
							</tr>
						</table>
					</div>
				</form>
			</div>
			<div id="tabs-2">
				<form action="home/addroot.wkm" method="post" id="form1">
					<div>
						<table border="0" style="font-size: 12">
							<tr>
								<td>
									所有菜单：
								</td>
								<td>
									<select id="form11" name="itemParent">
										<c:forEach var="item" items="${list}" varStatus="index">
											<c:choose>
												<c:when test="${index.index == 0}">
													<option value="${item.itemId}" selected="selected">${item.itemName}</option>
												</c:when>
												<c:otherwise>
													<option value="${item.itemId}">${item.itemName}</option>
												</c:otherwise>
											</c:choose>
										</c:forEach>
									</select>
								</td>
							</tr>
							<tr>
								<td>
									名称:
								</td>
								<td>
									<input id="form12" name="itemName" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<input id="form13" name="itemType" type="hidden" value="1" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<input id="form14" name="itemSeq" type="hidden" value="0" />
								</td>
							</tr>
							<tr>
								<td>
									备注:
								</td>
								<td>
									<textarea id="form15" name="itemDesc" rows="10" cols="30"></textarea>
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<input id="form16" name="itemId" type="hidden" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<input name="sure" type="submit" value="提交" />
									<input name="cancel" type="reset" value="取消" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<c:out value="${messageForm1}"></c:out>
									<input id="form17" name="tabIndex" value="1" type="hidden" />
								</td>
							</tr>
						</table>
					</div>
				</form>
			</div>
			<div id="tabs-3">
				<form action="home/addbody.wkm" method="post" id="form2">
					<div>
						<table border="0" style="font-size: 12">
							<tr>
								<td>
									所有菜单：
								</td>
								<td>
									<input id="form21" type="hidden" name="itemParent"/>
								</td>
							</tr>
							<tr>
								<td>
									名称:
								</td>
								<td>
									<input id="form22" name="itemName" />
								</td>
							</tr>
							<tr>
								<td>
									官方地址:
								</td>
								<td>
									<input id="form23" name="target" value="http://"/>
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<input id="form24" name="itemSeq" type="hidden" value="0" />
								</td>
							</tr>
							<tr>
								<td>
									备注:
								</td>
								<td>
									<textarea id="form25" name="itemDesc" rows="10" cols="30"></textarea>
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<input id="form26" name="itemId" type="hidden" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<input name="sure" type="submit" value="提交" />
									<input name="cancel" type="reset" value="取消" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<c:out value="${messageForm2}"></c:out>
									<input id="form27" name="tabIndex" value="2" type="hidden" />
								</td>
							</tr>
						</table>
					</div>
				</form>
			</div>
			<div id="tabs-4">
				<form action="home/addhome.wkm" method="post" id="form3">
					<div>
						<table border="0" style="font-size: 12">
							<tr>
								<td>
									名称：
								</td>
								<td>
									<input id="form31" name="urlName"/>
								</td>
							</tr>
							<tr>
								<td>
									页面高度:
								</td>
								<td>
									<input id="form32" name="urlPageHeight" />
								</td>
							</tr>
							<tr>
								<td>
									页面地址:
								</td>
								<td>
									<input id="form33" name="urlAdd" value="http://"/>
								</td>
							</tr>
							<tr>
								<td>
									备注:
								</td>
								<td>
									<textarea id="form34" name="urlDesc" rows="10" cols="30"></textarea>
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<input id="form35" name="urlId" type="hidden" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<input name="sure" type="submit" value="提交" />
									<input name="cancel" type="reset" value="取消" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<c:out value="${messageForm3}"></c:out>
									<input id="form36" name="tabIndex" value="3" type="hidden" />
								</td>
							</tr>
						</table>
					</div>
				</form>
			</div>
		</div>
		<div id="buttons" style="vertical-align: middle" align="center">
			<input type="radio" id="map" name="radio"><label onclick="skipTo('index');" for="map">导航栏</label>
		</div>
	</body>
</html>
